package com.ruoyi.biz.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.biz.mapper.BizStationDrawingMapper;
import com.ruoyi.biz.domain.BizStationDrawing;
import com.ruoyi.biz.service.IBizStationDrawingService;

/**
 * 车站图纸Service业务层处理
 * 
 * @author cc
 * @date 2025-11-11
 */
@Service
public class BizStationDrawingServiceImpl implements IBizStationDrawingService 
{
    @Autowired
    private BizStationDrawingMapper bizStationDrawingMapper;

    /**
     * 查询车站图纸
     * 
     * @param id 车站图纸主键
     * @return 车站图纸
     */
    @Override
    public BizStationDrawing selectBizStationDrawingById(Long id)
    {
        return bizStationDrawingMapper.selectBizStationDrawingById(id);
    }

    /**
     * 查询车站图纸列表
     * 
     * @param bizStationDrawing 车站图纸
     * @return 车站图纸
     */
    @Override
    public List<BizStationDrawing> selectBizStationDrawingList(BizStationDrawing bizStationDrawing)
    {
        return bizStationDrawingMapper.selectBizStationDrawingList(bizStationDrawing);
    }

    /**
     * 新增车站图纸
     * 
     * @param bizStationDrawing 车站图纸
     * @return 结果
     */
    @Override
    public int insertBizStationDrawing(BizStationDrawing bizStationDrawing)
    {
        bizStationDrawing.setCreateTime(DateUtils.getNowDate());
        return bizStationDrawingMapper.insertBizStationDrawing(bizStationDrawing);
    }

    /**
     * 修改车站图纸
     * 
     * @param bizStationDrawing 车站图纸
     * @return 结果
     */
    @Override
    public int updateBizStationDrawing(BizStationDrawing bizStationDrawing)
    {
        bizStationDrawing.setUpdateTime(DateUtils.getNowDate());
        return bizStationDrawingMapper.updateBizStationDrawing(bizStationDrawing);
    }

    /**
     * 批量删除车站图纸
     * 
     * @param ids 需要删除的车站图纸主键
     * @return 结果
     */
    @Override
    public int deleteBizStationDrawingByIds(Long[] ids)
    {
        return bizStationDrawingMapper.deleteBizStationDrawingByIds(ids);
    }

    /**
     * 删除车站图纸信息
     * 
     * @param id 车站图纸主键
     * @return 结果
     */
    @Override
    public int deleteBizStationDrawingById(Long id)
    {
        return bizStationDrawingMapper.deleteBizStationDrawingById(id);
    }

    @Override
    public List<BizStationDrawing> getDrawingByUser(LoginUser user) {
        Long deptId = user.getDeptId();
        BizStationDrawing bizStationDrawing = new BizStationDrawing();
        bizStationDrawing.setDeptId(deptId);
        return bizStationDrawingMapper.selectBizStationDrawingList(bizStationDrawing);
    }
}
